home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
Slider.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-04-27
|
2KB
|
82 lines
#ifndef Slider_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define Slider_First
#include "CompVObject.h"
class Thumb;
typedef enum {
eSliderPageUpLeft = 1,
eSliderPageDownRight= 2,
eSliderThumb = 3
} SliderPartCodes;
//---- Slider ------------------------------------------------------------------
class Slider: public CompositeVObject {
protected:
Thumb *thumb;
Direction dir;
bool feedback;
Point minVal, maxVal, currVal, bubbleSize;
public:
MetaDef(Slider);
Slider(int id= cIdNone, Direction dir= eVert, bool fb= FALSE);
virtual Thumb *MakeThumb();
void SetContainer(VObject *v);
void Update(bool redraw= TRUE);
void SetOrigin(Point);
Command *DoLeftButtonDownCommand(Point, Token, int);
void Draw(Rectangle);
void SetVal(Point, bool redraw= FALSE);
Point GetVal()
{ return currVal; }
void SetMax(Point, bool redraw= FALSE);
Point GetMax()
{ return maxVal; }
void SetMin(Point, bool redraw= FALSE);
Point GetMin()
{ return minVal; }
void SetThumbRange(Point, bool redraw= FALSE);
Point GetThumbRange()
{ return bubbleSize; }
GrCursor GetCursor(Point);
void MoveThumb(Point);
int Where(Point);
Metric GetMinSize();
};
//---- Thumb -------------------------------------------------------------------
class Thumb: public VObject {
Slider *slider;
Direction dir;
public:
MetaDef(Thumb);
Thumb(Slider *sl, Direction d);
void Draw(Rectangle r);
Metric GetMinSize();
Command *DoLeftButtonDownCommand(Point, Token, int);
GrCursor GetCursor(Point);
};
//---- PagerCommand ------------------------------------------------------------
class PagerCommand: public Command {
Slider *slider;
int part;
public:
PagerCommand(Slider* s, int p);
void TrackFeedback(Point, Point, bool);
Command *TrackMouse(TrackPhase, Point, Point, Point);
};
#endif